package com.example.param.model;

import com.github.pagehelper.PageInfo;

import java.util.List;

public class PageResponse<T> {
    private List<T> data;
    private long total;
    private int pageNum;
    private int pageSize;
    private int pages;

    public PageResponse(PageInfo<T> info) {
        this.data = info.getList();
        this.total = info.getTotal();
        this.pageNum = info.getPageNum();
        this.pageSize = info.getPageSize();
        this.pages = info.getPages();
    }

    @Override
    public String toString() {
        return "PageResponse{" +
                "data=" + data +
                ", total=" + total +
                ", pageNum=" + pageNum +
                ", pageSize=" + pageSize +
                ", pages=" + pages +
                '}';
    }
}